<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>常用指令</title>
</head>
<body>
    <div id="app">
        <button @click='isShow=!isShow'>{{isShow?'隐藏':'显示'}}</button>
        <br>
        <span>显示</span><input type="checkbox" v-model="isShow">
        <h1 v-if='isShow'>这是一段隐藏的数据</h1>
        <h2 v-show="isShow">这也是可以隐藏的数据</h2>
        <ul>
            <li v-for="(b,i) in books">
                ({{i+1}})《{{b.name}}》，价格{{b.price}}
            </li>
        </ul>
    </div>
    <script src="../vue.js"></script>
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                isShow:true,
                books:[
                    {name:'三国演员',price:12},
                    {name:'水浒传',price:12},
                    {name:'红楼梦',price:12},
                ]
            },
        })
        
    </script>
</body>
</html>